﻿Module CodeContract
    Sub RequiresArgumentNotNull(ByVal argValue As Object, ByVal argName As String)
        If argValue Is Nothing Then
            Throw New ArgumentNullException(argName)
        End If
    End Sub

    Sub RequiresArgumentNotNull(ByVal argValue As Object, ByVal argName As String, ByVal message As String)
        If argValue Is Nothing Then
            Throw New ArgumentNullException(argName, message)
        End If
    End Sub

    Sub Requires(ByVal condition As Boolean, ByVal argName As String)
        If Not condition Then
            Throw New ArgumentException(argName)
        End If
    End Sub

    Sub Requires(ByVal condition As Boolean, ByVal argName As String, ByVal message As String)
        If Not condition Then
            Throw New ArgumentException(argName, message)
        End If
    End Sub
End Module
